package com.ruoyi.framework.web.service;

import com.ruoyi.common.core.domain.entity.MemberUser;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MemberLoginService {

    @Autowired
    private TokenService tokenService;

    public String login(MemberUser member){
        LoginUser loginUser = new LoginUser(member.getId(),member);
        SysUser sysUser = new SysUser();
        loginUser.setUser(sysUser);
        return tokenService.createToken(loginUser);
    }
}
